🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / model / src / commonMain / kotlin / org / meshtastic / core / model / geofence / ActiveWaypoints.kt
Displaying Raw • Download
core/model/src/commonMain/kotlin/org/meshtastic/core/model/geofence/ActiveWaypoints.kt bf929c20f274232e0eb8ddc19b2dc82403e99e5b (bf929c20) Text, 1.74 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model.geofence
Tff7b72import T7ee787org.meshtastic.core.model.DataPacket
T8b949e/**
* Collapse a raw waypoint-packet list into the set of currently active waypoints, keyed by waypoint id.
*
* `PacketRepository.getWaypoints()` is a row-PER-TRANSMISSION firehose: every re-broadcast or edit inserts a new
* `packet` row (keyed on the random MeshPacket transmission id, not the semantic waypoint id). Consumers must normalise
* — latest transmission wins, expired waypoints dropped — or they will see duplicate/stale geofences and keep alerting
* on waypoints the user can no longer see. Both the map UI and the geofence engine go through here so they cannot
* drift. Rows are ordered oldest-first, so `associateBy` keeps the newest copy per id.
*/
Tff7b72fun Td2a8ffListTff7b72<Te6edf3DataPacketTff7b72>Tb4b4b4.Te6edf3activeWaypointPacketsTb4b4b4(Te6edf3nowSecondsTb4b4b4: Tffa657LongTb4b4b4)Tb4b4b4: Te6edf3MapTff7b72<Tffa657IntTb4b4b4, Te6edf3DataPacketTff7b72> Tff7b72= Te6edf3filter Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3waypoint Tff7b72!Tff7b72= Tff7b72null Tb4b4b4}
Tb4b4b4.Te6edf3associateBy Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3waypointTff7b72!!Tb4b4b4.Te6edf3id Tb4b4b4}
Tb4b4b4.Te6edf3filterValues Tb4b4b4{
Tff7b72val Te6edf3expire Tff7b72= Tffa657itTb4b4b4.Te6edf3waypointTff7b72?.Te6edf3expire Tff7b72?: T79c0ff0
Te6edf3expire Tff7b72=Tff7b72= T79c0ff0 Tff7b72|Tff7b72| Te6edf3expireTb4b4b4.Te6edf3toLongTb4b4b4(Tb4b4b4) Tff7b72> Te6edf3nowSeconds
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s